<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>DSP: DSP.Utilities Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">DSP
   &#160;<span id="projectnumber">1.5.0</span>
   </div>
   <div id="projectbrief">Digital Signal Processing</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespace_d_s_p.html">DSP</a>      </li>
      <li class="navelem"><a class="el" href="class_d_s_p_1_1_utilities.html">Utilities</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a>  </div>
  <div class="headertitle">
<div class="title">DSP.Utilities Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="DSP::Utilities" -->
<p><a href="class_d_s_p_1_1_utilities-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_s_p_1_1_utilities.html#a64504bebb0420ec5e22dadc31e66216e">MSE</a> (ref double[] signal_1, ref double[] signal_2, int SizeToCompare)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static Boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_s_p_1_1_utilities.html#a5ca02105d4fc904359afb4c39476157f">IsPowerOfTwo</a> (UInt32 x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Verifies a number is a power of two.  <a href="#a5ca02105d4fc904359afb4c39476157f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static UInt32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_s_p_1_1_utilities.html#ad84fc51b9d22a7e73e33096f53719c89">NextPowerOfTwo</a> (UInt32 x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get Next power of number.  <a href="#ad84fc51b9d22a7e73e33096f53719c89"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static Double[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_s_p_1_1_utilities.html#ac659c02356fbb637c08fe2285b313f51">triangularExtraction</a> (ref Double[] value, uint width, uint height, uint num, int fill=-1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static Double[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_s_p_1_1_utilities.html#a5f05a6c975a3e3b291f7bba9921330de">squareExtraction</a> (ref Double[] value, uint width, uint height, uint num, int fill=-1)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Make an extraction of square shape from the matrix starting from (0,0) coordinates.  <a href="#a5f05a6c975a3e3b291f7bba9921330de"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_s_p_1_1_utilities.html#a42d615404a4fcdd735a4d21b00362e44">ColorToGray</a> (int color)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_s_p_1_1_utilities.html#a1db423a5563a1f41e19eda3578b359b4">saveSignal</a> (ref double[] signal, string fileName)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static double[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_s_p_1_1_utilities.html#a22b43234063d77a82b7a1f988eb98025">loadSignal</a> (string fileName)</td></tr>
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc4b994616cdfaeba0a7b75b271dad5f"></a><!-- doxytag: member="DSP::Utilities::DDC_PI" ref="adc4b994616cdfaeba0a7b75b271dad5f" args="" -->
const Double&#160;</td><td class="memItemRight" valign="bottom"><b>DDC_PI</b> = 3.14159265358979323846</td></tr>
</table>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a42d615404a4fcdd735a4d21b00362e44"></a><!-- doxytag: member="DSP::Utilities::ColorToGray" ref="a42d615404a4fcdd735a4d21b00362e44" args="(int color)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static int <a class="el" href="class_d_s_p_1_1_utilities.html#a42d615404a4fcdd735a4d21b00362e44">DSP.Utilities.ColorToGray</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>color</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Convert a color to grayscale.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">color</td><td>Color to convert</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5ca02105d4fc904359afb4c39476157f"></a><!-- doxytag: member="DSP::Utilities::IsPowerOfTwo" ref="a5ca02105d4fc904359afb4c39476157f" args="(UInt32 x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static Boolean <a class="el" href="class_d_s_p_1_1_utilities.html#a5ca02105d4fc904359afb4c39476157f">DSP.Utilities.IsPowerOfTwo</a> </td>
          <td>(</td>
          <td class="paramtype">UInt32&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Verifies a number is a power of two. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>Number to check</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if number is a power two (i.e.:1,2,4,8,16,...)</dd></dl>

</div>
</div>
<a class="anchor" id="a22b43234063d77a82b7a1f988eb98025"></a><!-- doxytag: member="DSP::Utilities::loadSignal" ref="a22b43234063d77a82b7a1f988eb98025" args="(string fileName)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static double [] <a class="el" href="class_d_s_p_1_1_utilities.html#a22b43234063d77a82b7a1f988eb98025">DSP.Utilities.loadSignal</a> </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>fileName</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Load a signal from a file</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">signal</td><td>Signal to load</td></tr>
    <tr><td class="paramname">fileName</td><td>Name of the file</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a64504bebb0420ec5e22dadc31e66216e"></a><!-- doxytag: member="DSP::Utilities::MSE" ref="a64504bebb0420ec5e22dadc31e66216e" args="(ref double[] signal_1, ref double[] signal_2, int SizeToCompare)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static double <a class="el" href="class_d_s_p_1_1_utilities.html#a64504bebb0420ec5e22dadc31e66216e">DSP.Utilities.MSE</a> </td>
          <td>(</td>
          <td class="paramtype">ref double[]&#160;</td>
          <td class="paramname"><em>signal_1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ref double[]&#160;</td>
          <td class="paramname"><em>signal_2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>SizeToCompare</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Calculate the Mean squared error.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">signal_1</td><td>First signal to compare</td></tr>
    <tr><td class="paramname">signal_2</td><td>Second signal to compare</td></tr>
    <tr><td class="paramname">SizeToCompare</td><td>Max size of element to compare. If size of one signal is less then this value function returns -1.</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad84fc51b9d22a7e73e33096f53719c89"></a><!-- doxytag: member="DSP::Utilities::NextPowerOfTwo" ref="ad84fc51b9d22a7e73e33096f53719c89" args="(UInt32 x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static UInt32 <a class="el" href="class_d_s_p_1_1_utilities.html#ad84fc51b9d22a7e73e33096f53719c89">DSP.Utilities.NextPowerOfTwo</a> </td>
          <td>(</td>
          <td class="paramtype">UInt32&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get Next power of number. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>Number to check</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A power of two number</dd></dl>

</div>
</div>
<a class="anchor" id="a1db423a5563a1f41e19eda3578b359b4"></a><!-- doxytag: member="DSP::Utilities::saveSignal" ref="a1db423a5563a1f41e19eda3578b359b4" args="(ref double[] signal, string fileName)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="class_d_s_p_1_1_utilities.html#a1db423a5563a1f41e19eda3578b359b4">DSP.Utilities.saveSignal</a> </td>
          <td>(</td>
          <td class="paramtype">ref double[]&#160;</td>
          <td class="paramname"><em>signal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>fileName</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Saves a signal into a file</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">signal</td><td>Signal to save</td></tr>
    <tr><td class="paramname">fileName</td><td>Name of the file</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5f05a6c975a3e3b291f7bba9921330de"></a><!-- doxytag: member="DSP::Utilities::squareExtraction" ref="a5f05a6c975a3e3b291f7bba9921330de" args="(ref Double[] value, uint width, uint height, uint num, int fill=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static Double [] <a class="el" href="class_d_s_p_1_1_utilities.html#a5f05a6c975a3e3b291f7bba9921330de">DSP.Utilities.squareExtraction</a> </td>
          <td>(</td>
          <td class="paramtype">ref Double[]&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fill</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Make an extraction of square shape from the matrix starting from (0,0) coordinates. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>Matrix to manage</td></tr>
    <tr><td class="paramname">width</td><td>Width of the matrix</td></tr>
    <tr><td class="paramname">height</td><td>Height of the matrix</td></tr>
    <tr><td class="paramname">num</td><td>Number of elements to extract</td></tr>
    <tr><td class="paramname">fill</td><td>If different from -1 fills the selected elements in the Matrix with this value</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac659c02356fbb637c08fe2285b313f51"></a><!-- doxytag: member="DSP::Utilities::triangularExtraction" ref="ac659c02356fbb637c08fe2285b313f51" args="(ref Double[] value, uint width, uint height, uint num, int fill=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static Double [] <a class="el" href="class_d_s_p_1_1_utilities.html#ac659c02356fbb637c08fe2285b313f51">DSP.Utilities.triangularExtraction</a> </td>
          <td>(</td>
          <td class="paramtype">ref Double[]&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fill</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Make an extraction of triangular shape from the matrix starting from (0,0) coordinates.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>Matrix to manage</td></tr>
    <tr><td class="paramname">width</td><td>Width of the matrix</td></tr>
    <tr><td class="paramname">height</td><td>Height of the matrix</td></tr>
    <tr><td class="paramname">num</td><td>Number of elements to extract</td></tr>
    <tr><td class="paramname">fill</td><td>If different from -1 fills the selected elements in the Matrix with this value</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>DSP.cs</li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Dec 5 2012 19:24:55 for DSP by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
